package org.example.day20240814;

import java.util.Scanner;

public class test5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String[] strArr = str.split("-");
        int sum=0;
        for(int i=0;i<strArr.length;i++){
            char[] arr = strArr[i].toCharArray();
            for(int j=0;j<arr.length;j++){
                if(i==1){
                    sum += (arr[j]-'0')*(i+j+1);
                }
                if(i==2){
                    sum += (arr[j]-'0')*(i+j+3);
                }
            }
        }
        int result = sum%11;
        String Result;
        if(result<10){
            Result = String.valueOf(result);
        }else {
            Result = "X";
        }
        if(Integer.parseInt(strArr[3])==result || strArr[3].equals(Result)){
            System.out.println("Right");
        }
        if(!strArr[3].equals(Result)){
            System.out.println(strArr[0]+"-"+strArr[1]+"-"+strArr[2]+"-"+Result);
        }
    }
}
